import Route from 'react-router/lib/Route';

import { IndexRedirect } from 'react-router';
import Home from './components/Home';
import CarManager from './components/CarManager';
import CarSearch from './components/CarSearch'; // 车辆查询
import CarFlowList from './components/CarFlowList'; // 车辆流程列表--车辆申请审批
import CarUseView from './components/carUseView/CarUseView'; // 车辆流程列表--车辆申请审批
import CarApplySetting from './components/carUseView/CarApplySetting.js'; // 车辆后台--应用设置
import CarType from './components/carUseView/CarType.js'; // 车辆后台--车辆类型
import CarUseCarWorkflowSet from './components/carUseView/CarUseCarWorkflowSet.js';// 车辆后台-用车流程设置
import CarViewSington from './components/car/dialog/CarViewSington';// 车辆单页
import { WeaLocaleProvider, WeaErrorPage } from 'ecCom';

const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'car');
import './style/index';

class Error extends React.Component {
  render() {
    return (
      <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@nw6iy1`} msg="对不起，无法找到该页面！" />
    );
  }
}
const carRoute = (
  <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@qh4nxy`} path="car" onEnter={getLocaleLabel} component={Home}>
    <IndexRedirect ecId={`${this && this.props && this.props.ecId || ''}_IndexRedirect@qczpbw`} to="carUseView" />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@h8c8gt`} path="carManager" component={CarManager} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@rvq6yu`} path="carSearch" component={CarSearch} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@cmqs9s`} path="carFlowList" component={CarFlowList} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@fkunsd`} path="carUseView" component={CarUseView} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@wa3ixq`} path="carApplySetting" component={CarApplySetting} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@hr8hf8`} path="carType" component={CarType} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@9bwngy`} path="carUseCarWorkflowSet" component={CarUseCarWorkflowSet} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@3cdat6`} path="CarViewSington" component={CarViewSington} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@82qg2s`} path="*" component={Error} />
  </Route>
);

import stores from './stores/index';

window.carStore = stores;

module.exports = {
  Route: carRoute,
  store: stores,
};
